<template>
  <div>
    <Head />
    <Main />
    <Foot v-if="!isPersonCenter" />
  </div>
</template>

<script>
import Head from "./components/Head";
import Main from "./components/Main";
import Foot from "./components/Foot";

export default {
  components: {
    Head,
    Main,
    Foot,
  },
  data () {
    return {
      isPersonCenter: false
    }
  },
  watch: {
    $route: {
      handler: function (route) {
        // 此处监听是为了知道当前菜单是否到了个人中心页面
        if (route.path.indexOf("/user") !== -1) {
          this.isPersonCenter = true;
        } else {
          this.isPersonCenter = false;
        }
      },
      immediate: true,
    }
  },
};
</script>

<style>
</style>
